package com.qidian.permission.mapper;

import com.qidian.permission.entity.Permission;
import com.qidian.permission.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author 戴着假发的程序员
 * @Company 起点编程
 * @Time 2023/10/18 10:19
 * @Description
 */
public interface UserMapper {
    /**
     * 根据用户编号查询用户信息
     * @param userId
     * @return
     */
    User selectById(Long userId);

    /**
     *
     * @param user
     * @return
     */
    int save(User user);

    /**
     *
     * @param username
     * @return
     */
    User selectByUsername(String username);

    /**
     *
     * @param user
     * @param start
     * @param limit
     * @return
     */
    List<User> selectByPage(@Param("user") User user, @Param("start") Integer start, @Param("limit") Integer limit);

    /**
     *
     * @param user
     * @return
     */
    Integer selectCount(User user);

    /**
     *
     * @param user
     * @return
     */
    Integer update(User user);

    /**
     * 通过id删除用户信息  逻辑删除
     * @param userId
     * @return
     */
    int deleteByUserId(Long userId);

    int deletesByUserId(Long [] userIds);

}
